﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 立顶申请非赎楼信息表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_APP_PROUNFORHOUINFO: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_APP_PROUNFORHOUINFO()
		{}
		#region Model
		private long _id;
		private long _procid;
		private long _reginfoid;
		private long _riskbyid;
		private string _riskbyname;
		private string _legal;
		private string _legaltel;
		private string _legaltel2;
		private string _conby;
		private string _conbytel;
		private string _conbytel2;
		private string _corpaddress;
		private decimal _regamount;
		private string _mainbuss;
		private int _repayment;
		private string _usefor;
		private decimal _advamt;
		private string _bussbrief;
		private string _loanmode;
		private string _repaysource;
		private int _sparefield1;
		private string _sparefield2;
		private string _sparefield3;
		/// <summary>
		/// 主键ID主键ID，唯一
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 立顶申请记录IDTb_App_ProcInfo.ID唯一
		/// </summary>
		[DataMember]
		public long PROCID
		{
			get{return _procid;}
			set{
				if ( _procid!= value)
				{
					 _procid = value;
					OnPropertyChanged("PROCID");
				}
			}
		}
		/// <summary>
		/// 申请登记记录ID
		/// </summary>
		[DataMember]
		public long REGINFOID
		{
			get{return _reginfoid;}
			set{
				if ( _reginfoid!= value)
				{
					 _reginfoid = value;
					OnPropertyChanged("REGINFOID");
				}
			}
		}
		/// <summary>
		/// 跟进风控记录ID
		/// </summary>
		[DataMember]
		public long RISKBYID
		{
			get{return _riskbyid;}
			set{
				if ( _riskbyid!= value)
				{
					 _riskbyid = value;
					OnPropertyChanged("RISKBYID");
				}
			}
		}
		/// <summary>
		/// 跟进风控员姓名
		/// </summary>
		[DataMember]
		public string RISKBYNAME
		{
			get{return _riskbyname;}
			set{
				if ( _riskbyname!= value)
				{
					 _riskbyname = value;
					OnPropertyChanged("RISKBYNAME");
				}
			}
		}
		/// <summary>
		/// 法定代表人
		/// </summary>
		[DataMember]
		public string LEGAL
		{
			get{return _legal;}
			set{
				if ( _legal!= value)
				{
					 _legal = value;
					OnPropertyChanged("LEGAL");
				}
			}
		}
		/// <summary>
		/// 法定代表人手机1
		/// </summary>
		[DataMember]
		public string LEGALTEL
		{
			get{return _legaltel;}
			set{
				if ( _legaltel!= value)
				{
					 _legaltel = value;
					OnPropertyChanged("LEGALTEL");
				}
			}
		}
		/// <summary>
		/// 法定代表人手机2
		/// </summary>
		[DataMember]
		public string LEGALTEL2
		{
			get{return _legaltel2;}
			set{
				if ( _legaltel2!= value)
				{
					 _legaltel2 = value;
					OnPropertyChanged("LEGALTEL2");
				}
			}
		}
		/// <summary>
		/// 实际控制人
		/// </summary>
		[DataMember]
		public string CONBY
		{
			get{return _conby;}
			set{
				if ( _conby!= value)
				{
					 _conby = value;
					OnPropertyChanged("CONBY");
				}
			}
		}
		/// <summary>
		/// 实际控制人手机1
		/// </summary>
		[DataMember]
		public string CONBYTEL
		{
			get{return _conbytel;}
			set{
				if ( _conbytel!= value)
				{
					 _conbytel = value;
					OnPropertyChanged("CONBYTEL");
				}
			}
		}
		/// <summary>
		/// 实际控制人手机2
		/// </summary>
		[DataMember]
		public string CONBYTEL2
		{
			get{return _conbytel2;}
			set{
				if ( _conbytel2!= value)
				{
					 _conbytel2 = value;
					OnPropertyChanged("CONBYTEL2");
				}
			}
		}
		/// <summary>
		/// 公司地址
		/// </summary>
		[DataMember]
		public string CORPADDRESS
		{
			get{return _corpaddress;}
			set{
				if ( _corpaddress!= value)
				{
					 _corpaddress = value;
					OnPropertyChanged("CORPADDRESS");
				}
			}
		}
		/// <summary>
		/// 注册资本
		/// </summary>
		[DataMember]
		public decimal REGAMOUNT
		{
			get{return _regamount;}
			set{
				if ( _regamount!= value)
				{
					 _regamount = value;
					OnPropertyChanged("REGAMOUNT");
				}
			}
		}
		/// <summary>
		/// 主营业务
		/// </summary>
		[DataMember]
		public string MAINBUSS
		{
			get{return _mainbuss;}
			set{
				if ( _mainbuss!= value)
				{
					 _mainbuss = value;
					OnPropertyChanged("MAINBUSS");
				}
			}
		}
		/// <summary>
		/// 还款方式
		/// </summary>
		[DataMember]
		public int REPAYMENT
		{
			get{return _repayment;}
			set{
				if ( _repayment!= value)
				{
					 _repayment = value;
					OnPropertyChanged("REPAYMENT");
				}
			}
		}
		/// <summary>
		/// 用途
		/// </summary>
		[DataMember]
		public string USEFOR
		{
			get{return _usefor;}
			set{
				if ( _usefor!= value)
				{
					 _usefor = value;
					OnPropertyChanged("USEFOR");
				}
			}
		}
		/// <summary>
		/// 预收费用默认0
		/// </summary>
		[DataMember]
		public decimal ADVAMT
		{
			get{return _advamt;}
			set{
				if ( _advamt!= value)
				{
					 _advamt = value;
					OnPropertyChanged("ADVAMT");
				}
			}
		}
		/// <summary>
		/// 业务简述
		/// </summary>
		[DataMember]
		public string BUSSBRIEF
		{
			get{return _bussbrief;}
			set{
				if ( _bussbrief!= value)
				{
					 _bussbrief = value;
					OnPropertyChanged("BUSSBRIEF");
				}
			}
		}
		/// <summary>
		/// 贷款方式
		/// </summary>
		[DataMember]
		public string LOANMODE
		{
			get{return _loanmode;}
			set{
				if ( _loanmode!= value)
				{
					 _loanmode = value;
					OnPropertyChanged("LOANMODE");
				}
			}
		}
		/// <summary>
		/// 还款来源
		/// </summary>
		[DataMember]
		public string REPAYSOURCE
		{
			get{return _repaysource;}
			set{
				if ( _repaysource!= value)
				{
					 _repaysource = value;
					OnPropertyChanged("REPAYSOURCE");
				}
			}
		}
		/// <summary>
		/// 预留字段1
		/// </summary>
		[DataMember]
		public int SPAREFIELD1
		{
			get{return _sparefield1;}
			set{
				if ( _sparefield1!= value)
				{
					 _sparefield1 = value;
					OnPropertyChanged("SPAREFIELD1");
				}
			}
		}
		/// <summary>
		/// 预留字段2
		/// </summary>
		[DataMember]
		public string SPAREFIELD2
		{
			get{return _sparefield2;}
			set{
				if ( _sparefield2!= value)
				{
					 _sparefield2 = value;
					OnPropertyChanged("SPAREFIELD2");
				}
			}
		}
		/// <summary>
		/// 预留字段3
		/// </summary>
		[DataMember]
		public string SPAREFIELD3
		{
			get{return _sparefield3;}
			set{
				if ( _sparefield3!= value)
				{
					 _sparefield3 = value;
					OnPropertyChanged("SPAREFIELD3");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

